{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Numpy 简介"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入numpy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Numpy**是**Python**的一个很重要的第三方库，很多其他科学计算的第三方库都是以**Numpy**为基础建立的。\n",
    "\n",
    "**Numpy**的一个重要特性是它的数组计算。\n",
    "\n",
    "在使用**Numpy**之前，我们需要导入`numpy`包："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from numpy import *\n",
    "import matplotlib"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用前一定要先导入 Numpy 包，导入的方法有以下几种：\n",
    "\n",
    "```python    \n",
    "    import numpy\n",
    "    import numpy as np\n",
    "    from numpy import *\n",
    "    from numpy import array, sin\n",
    "```\n",
    " 也可以使用magic命令开启numpy\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using matplotlib backend: MacOSX\n",
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数组上的数学操作"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "假如我们想将列表中的每个元素增加`1`，但列表不支持这样的操作（报错）："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "can only concatenate list (not \"int\") to list",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-3-068856d2a224>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0ma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0ma\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m: can only concatenate list (not \"int\") to list"
     ]
    }
   ],
   "source": [
    "a = [1, 2, 3, 4]\n",
    "a + 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "转成 `array` ："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = array(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`array` 数组支持每个元素加 `1` 这样的操作："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 3, 4, 5])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a + 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "与另一个 `array` 相加，得到对应元素相加的结果："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 5, 7, 9])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = array([2, 3, 4, 5])\n",
    "a + b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对应元素相乘："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对应元素乘方："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([1, 2, 3, 4]), array([2, 3, 4, 5]))"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a,b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([   1,    8,   81, 1024])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a ** b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "b = a[0:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "operands could not be broadcast together with shapes (4,) (2,) ",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-15-f1d53b280433>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m: operands could not be broadcast together with shapes (4,) (2,) "
     ]
    }
   ],
   "source": [
    "a+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[   1    8   81 1024]\n"
     ]
    }
   ],
   "source": [
    "from numpy import *\n",
    "a = [1, 2, 3, 4]\n",
    "a = array(a)\n",
    "b = array([2, 3, 4, 5])\n",
    "print(a**b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 提取数组中的元素"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "提取第一个元素："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "提取前两个元素："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a[:2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最后两个元素："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 4])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a[-2:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "将它们相加："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([4, 6])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a[:2] + a[-2:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 修改数组形状："
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "查看 `array` 的形状："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4,)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.size"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "修改 `array` 的形状："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2],\n",
       "       [3, 4]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.shape = 2,2\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 多维数组"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`a` 现在变成了一个二维的数组，可以进行加法："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2],\n",
       "       [3, 4]])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[2, 4],\n",
       "       [6, 8]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a + a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "乘法仍然是对应元素的乘积，并不是按照矩阵乘法来计算："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[1, 2],\n",
       "        [3, 4]]), array([[ 1,  4],\n",
       "        [ 9, 16]]))"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a,a * a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 画图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "linspace 用来生成一组等间隔的数据："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.,  1.,  2.,  3.,  4.])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linspace(0,4,5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.   ,  0.314,  0.628,  0.942,  1.257,  1.571,  1.885,  2.199,\n",
       "        2.513,  2.827,  3.142,  3.456,  3.77 ,  4.084,  4.398,  4.712,\n",
       "        5.027,  5.341,  5.655,  5.969,  6.283])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = linspace(0, 2*pi, 21)\n",
    "%precision 3\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "三角函数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  0.000e+00,   3.090e-01,   5.878e-01,   8.090e-01,   9.511e-01,\n",
       "         1.000e+00,   9.511e-01,   8.090e-01,   5.878e-01,   3.090e-01,\n",
       "         1.225e-16,  -3.090e-01,  -5.878e-01,  -8.090e-01,  -9.511e-01,\n",
       "        -1.000e+00,  -9.511e-01,  -8.090e-01,  -5.878e-01,  -3.090e-01,\n",
       "        -2.449e-16])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = sin(a)\n",
    "b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画出图像："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7fa0c6d55550>]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu81VP+x/HXp4tSqSl3UhEh15hJaegkUSYSQknNRJKo\nMHLLKCPiZ6aiNCLXX8UgVPJzmTq5R0j3K11IjUjI4FTr98fazaTp1Nnn7L3X97u/7+fjcR7n0rf9\nfUt9zjrru9ZnmXMOERHJf+VCBxARkdxQwRcRSQgVfBGRhFDBFxFJCBV8EZGEUMEXEUmIjBR8Mxtt\nZmvMbNYOrrnXzBab2UwzOzYT9xURkZLL1Aj/EeD04n7RzNoA9Z1zhwA9gL9l6L4iIlJCGSn4zrk3\ngXU7uKQd8Hjq2ulADTPbOxP3FhGRksnVHP7+wMqtPv889TUREckRPbQVEUmICjm6z+fAAVt9Xjv1\ntf9iZmruIyKSJuec7eyaTI7wLfW2PROALgBm1gT4xjm3prgXcs7F8u3WW2/N2Gv9+KNj/Hh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npxzm51zjYDawAlm1jB0ppIws98Ba1I/YRk7blMSVc2c\nc8fhf0rplZrijIsKwHHAiNR/ww/ADWEjpc/MKgJnAU/v6LqoFPzPgTpbfV479TXJkdTc5TPAE865\nF0LnKa3Uj+NTgdahs5RQM+Cs1Dz4OKCFmT0eOFNanHNfpN5/CTyHn6KNi8+Alc65GanPn8F/A4ib\nNsAHqf8HxYpKwf/35iwz2wW/OStuqxXiOjrb4mFgnnNuWOgg6TKzPcysRurjXYFWQCweODvnbnLO\n1XHOHYT/ez/FOdcldK6SMrMqqZ8MMbOqwGlAhhoxZ59zbg2w0swapL7UEpgXMFJpdWQn0zkQkSMO\nnXObzGzL5qxywOg4bc4ys7FAAbC7ma0Abt3yECgOzKwZcBEwOzUP7oCbnHP/FzZZie0LPJZapVAO\neMo5NzlwpqTYG3gu1RKlAjDGOfdK4Ezp6g2MSU2LfAL8IXCetJhZFfwD28t2em0UlmWKiEj2RWVK\nR0REskwFX0QkIVTwRUQSQgVfRCQhVPBFRBJCBV9EJCFU8EVEEkIFX0QkIf4fDfcnYacx02EAAAAA\nSUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa0c653c690>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "plot(a,b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7fa0c6ef4990>]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu81VP+x/HXp4tSqSl3UhEh15hJaegkUSYSQknNRJKo\nMHLLKCPiZ6aiNCLXX8Ug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m2lm1YAPgHZx+fMHMLMq\nzrkfzKw88BbQ2zkXm+JjZlcDxwPVnXNnhc6TDjP7BDjeObcudJbSMLNHgWnOuUfMrAJQxTn3beBY\naUvV0c+AE5xzK7d3TVRG+LHenOWcexOI5V92AOfcaufczNTH3wPzidleCefcD6kPK+EXI4QfyZSQ\nmdUGzgAeCp2llIzo1JK0mFl14CTn3CMAzrmNcSz2KacCS4sr9hCd/0nanBURZlYPOBaYHjZJelJT\nIh8Bq4E4chsnAAAB6ElEQVRXnXPvh86UhiHAdcTom9Q2HPCqmb1vZt1Dh0nTgcBaM3skNS0yysx2\nDR2qlC4Axu3ogqgUfImA1HTOM0Cf1Eg/Npxzm51zjYDawAlm1jB0ppIws98Ba1I/YRk7blMSVc2c\nc8fhf0rplZrijIsKwHHAiNR/ww/ADWEjpc/MKgJnAU/v6LqoFPzPgTpbfV479TXJkdTc5TPAE865\nF0LnKa3Uj+NTgdahs5RQM+Cs1Dz4OKCFmT0eOFNanHNfpN5/CTyHn6KNi8+Alc65GanPn8F/A4ib\nNsAHqf8HxYpKwf/35iwz2wW/OStuqxXiOjrb4mFgnnNuWOgg6TKzPcysRurjXYFWQCweODvnbnLO\n1XHOHYT/ez/FOdcldK6SMrMqqZ8MMbOqwGlAhhoxZ59zbg2w0swapL7UEpgXMFJpdWQn0zkQkSMO\nnXObzGzL5qxywOg4bc4ys7FAAbC7ma0Abt3yECgOzKwZcBEwOzUP7oCbnHP/FzZZie0LPJZapVAO\neMo5NzlwpqTYG3gu1RKlAjDGOfdK4Ezp6g2MSU2LfAL8IXCetJhZFfwD28t2em0UlmWKiEj2RWVK\nR0REskwFX0QkIVTwRUQSQgVfRCQhVPBFRBJCBV9EJCFU8EVEEkIFX0QkIf4fDfcnYacx02EAAAAA\nSUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa0c6e61950>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "from numpy import *\n",
    "from matplotlib.pyplot import *\n",
    "a = linspace(0, 2*pi, 21)\n",
    "b = sin(a)\n",
    "plot(a,b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 从数组中选择元素"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "假设我们想选取数组b中所有非负的部分，首先可以利用 `b` 产生一组布尔值："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  0.000e+00,   3.090e-01,   5.878e-01,   8.090e-01,   9.511e-01,\n",
       "         1.000e+00,   9.511e-01,   8.090e-01,   5.878e-01,   3.090e-01,\n",
       "         1.225e-16,  -3.090e-01,  -5.878e-01,  -8.090e-01,  -9.511e-01,\n",
       "        -1.000e+00,  -9.511e-01,  -8.090e-01,  -5.878e-01,  -3.090e-01,\n",
       "        -2.449e-16])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True,  True,  True,  True,  True,  True,  True,  True,  True,\n",
       "        True,  True, False, False, False, False, False, False, False,\n",
       "       False, False, False], dtype=bool)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b >= 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "mask = b >= 0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画出所有对应的非负值对应的点："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7fa0c7042f90>]"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    },
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gGsy8wfN39vzceAVfc50UAz83EfE84GPAm9tviIeKm3yD/T8\nZ+Ya8AsR8ULg4xFxXWZ+pd+5OtVB/l3P/168kl8Grtm0fXXzutYxL20zpl/a5s/Mi5f/W5WZnwKe\nExEv2r+IPRnkuW9r0Oc+Ig6xXpB/l5n/sMWQgZ7/dvkHff4vy8z/AR4AjrXcNNDzf9l2+buZ/70o\n+Y2TpyLiStZPnjrTMuYM8EbYOKN2y5On+qRt/s1reBFxhPW3on5nf2PuKNh+3W6Q5/6ybfMPwdz/\nDfCVzPyLbW4f9PnfMf8gz39EvDgirmpe/gngKHC+ZdjAzn8n+buZ/8qXa3LIT57qJD/w2xHxe8Al\n4H+B3+lf4h8XER8GasBPRsTXgSngSoZg7qF9fgZ77n8NuB34UnNdNYE/Zv2dWgM//53kZ4DnH/hp\n4G9j/dejjwAfac73UHQPHeSni/n3ZChJKph//k+SCmbJS1LBLHlJKpglL0kFs+QlqWCWvCQVzJKX\npIJZ8pJUsP8HyaKQQAX9e7cAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa0c6fdc2d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot(a[mask], b[mask], 'ro')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "aa = array([1,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "mask = array([True,False])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1])"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "aa[mask]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
